package org.vsg.security.model.service;

import java.io.Serializable;
import java.util.Collection;

import org.springframework.dao.DataAccessException;
import org.vsg.common.biz.exception.ServiceException;
import org.vsg.common.pagination.Pagination;
import org.vsg.common.pagination.PaginationException;
import org.vsg.common.pagination.carrier.Carrier;
import org.vsg.security.model.domain.SysUser;


public interface SysUserService {

	/**
	 * @param sysUser
	 * @exception ServiceException
	 */
	public void addSysUser(SysUser sysUser) throws ServiceException;

	/**
	 * 
	 * @param allSysUser
	 * @throws DataAccessException
	 */
	public void saveAll(Collection<SysUser> allSysUser) throws ServiceException;


	/**
	 * @param sysUser
	 * @exception ServiceException
	 */   
	public void updateSysUser(SysUser sysUser) throws ServiceException;
	
	
	/**
	 * @param sysUser
	 * @exception ServiceException
	 */   
	public void updateSimpleSysUser(SysUser sysUser) throws ServiceException;

	
	/**
	 * @param pk -- primary key for loading entity
	 * @exception ServiceException
	 */   
	public SysUser loadSysUser(Serializable pk) throws ServiceException;
	
	
	/**
	 * @param sysUser
	 * @exception ServiceException
	 */   
	public void deleteSysUser(SysUser sysUser) throws ServiceException;

	/**
	 * 
	 */
	public void removeUsers(int[] ids) throws ServiceException;

	
	/**
	 * 
	 * @param all
	 * @throws DataAccessException
	 */
	public void deleteAll(Collection<SysUser> all) throws ServiceException;

	
	
	
	
   	/** 
   	 * @param carrier
   	 * @exception ServiceException
   	 * @exception PaginationException
   	 */
   	public Pagination pageSysUser(Carrier carrier) throws ServiceException, PaginationException;
   	
   	
   
   
   	/** 
   	 * @param carrier
     * @exception ServiceException
     * @exception PaginationException
     *
     */
   	public Pagination pageSysUserByAll(Carrier carrier) throws ServiceException, PaginationException;
	

   	/**
   	 * show the select all defined
   	 * @return
   	 * @throws ServiceException
   	 */
	public Collection<SysUser> findByAll() throws ServiceException;

	
	public void assignRolesToUser(SysUser user , String[] roleIds) throws ServiceException;
	
	/**
	 * 
	 * @param user
	 * @param roleIds
	 * @throws ServiceException
	 */
	public void removeUserAssignedRole(SysUser user , String[] roleIds) throws ServiceException;

	
}